package rest.jbpm.wrappers.lists;

import java.util.*;
import javax.xml.bind.annotation.*;
import rest.jbpm.wrappers.HistoryTask;

@XmlRootElement
@XmlAccessorType(XmlAccessType.PROPERTY)
@XmlType(name = "historyTaskList", propOrder = {"historyTasks"})
public class HistoryTaskList {

	private List<HistoryTask> tasks;
	private String baseUri;
	
	protected HistoryTaskList() {
		
	}
	
	public HistoryTaskList(Collection<? extends org.jbpm.api.history.HistoryTask> tsks, String baseUri) {
		
		this.baseUri = baseUri;
		tasks = new ArrayList<HistoryTask>();
		
		for(org.jbpm.api.history.HistoryTask tsk : tsks)
			tasks.add(new HistoryTask(tsk,baseUri));

	}
	
	@XmlElement(name="historyTask",required=true)
	public List<HistoryTask> getHistoryTasks() {
		return tasks;
	}
}
